<template>
  <div class="member-coupon">
    <el-form>
      <el-form-item>
        <el-table :data="inviteList"
          max-height="550">
          <el-table-column prop="userId"
            label="会员ID">
          </el-table-column>
          <el-table-column prop="nickName"
            label="登录名称">
          </el-table-column>
          <el-table-column prop="name"
            label="姓名">
          </el-table-column>
           <el-table-column prop="phone"
            label="手机号">
          </el-table-column>
           <el-table-column prop="vip"
            label="会员等级">
          </el-table-column>
           <el-table-column prop="sex"
            label="性别">
          </el-table-column>
          <el-table-column prop="register"
            label="注册时间">
          </el-table-column>
          <el-table-column label="是否首单"
            prop="first">
          </el-table-column>
          <el-table-column label="订单数量"
            prop="orderNum">
          </el-table-column>
        </el-table>

      </el-form-item>
      <el-form-item style="margin-top: 20px;">
        <el-pagination @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="pageNo"
          :page-sizes="[10, 20, 30, 40]"
          :page-size="pageSize"
          layout="total, prev , pager , next, sizes, jumper"
          :total="total">
        </el-pagination>
      </el-form-item>
    </el-form>
    <div class="information-btn">
      <el-form-item>
        <el-button @click="$router.back()">返回</el-button>
      </el-form-item>
    </div>
  </div>
</template>
<script>
const Breadcrumb = () => import("@/components/common/Breadcrumb");
import { queryCouponInfoList } from "@/public/js/member";
export default {
  token: "",
  data() {
    return {
      inviteList: [],
      id: "",
      pageNo: 1,
      pageSize: 10,
      total: 0
    };
  },
  created() {
    //window.commo.showMenu(this)
    this.id = this.$route.query.id;
    this.getCouponInfoList();
  },
  methods: {
    getCouponInfoList() {
      queryCouponInfoList({
        userId: this.id,
        pageNo: this.pageNo,
        pageSize: this.pageSize
      }).then(res => {
        console.log(res);
        this.inviteList = res.data.inviteList;
        this.total = res.data.total;
      });
    },
    //  分页
    handleSizeChange(val) {
      this.pageSize = val;
      this.getCouponOrderList();
    },
    handleCurrentChange(val) {
      this.pageNo = val;
      this.getCouponOrderList();
    }
  },
  components: {
    Breadcrumb
  }
};
</script>
<style lang="scss">
</style>
